<template>
    <!-- 全屏展示图片 -->
    <div 
        class="show-pic"
        @click="closePic">
        <div class="long-scroll">
            <img 
                :src="imgUrl" 
                :style="{background:`url('${loadingUrl}') 50% 50% no-repeat`,'background-size': '100% 100%'}"
                alt="">
        </div>
    </div>
</template>

<script>
export default {
    name: 'showPic',
    props: {
        imgUrl: {
            type: String
        }
    },
    data() {
        return {
            loadingUrl: require('@/assets/img/loading2.gif'),
        }
    },
    methods: {
        closePic() {
            this.$emit('close',false);
        }
    }
}
</script>

<style lang="scss" scoped>
.show-pic {
    position: fixed;
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, .8);
    top: 0;
    left: 0;
    padding: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999999;
    img {
        width: 100%;
    }
    .long-scroll {
        width: 90%;
        height: 90%;
        overflow-y: scroll;
    }
}
</style>